//
//  NetClient.h
//  LegoClient
//
//  Created by Balazs Faludi on 03.01.10.
//  Copyright 2010 Universität Basel. All rights reserved.
//

#import <Foundation/Foundation.h>

@protocol NetClientDelegate;

@class NetConnection;

@interface NetClient : NSObject {
	NSString  *_type;
	int _port;
	NSObject <NetClientDelegate> *delegate;
	BOOL isConnected;
    NSNetServiceBrowser *_browser;
    NSNetService *_connectedService;
    NSMutableArray *_services;
	NetConnection *_connection;
}

@property (nonatomic, retain) NSObject <NetClientDelegate> *delegate;
@property (nonatomic, readonly) BOOL isConnected;

- (id)initWithType:(NSString *)type;
- (void)connectToService:(NSNetService *)service;
- (void)searchServices;

@end


@protocol NetClientDelegate

- (void)client:(NetClient *)client didFindServices:(NSArray *)services;
- (void)client:(NetClient *)client connected:(NetConnection *)connection;

@end